package com.spic.system.api.factory;

import com.spic.common.core.domain.R;
import com.spic.system.api.RemoteBlastAlarm;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * RemoteBlastAlarmFallbackFactory
 *
 * @author xuxiaochang@chinasofi.com
 * @date 2022/3/25
 */
public class RemoteBlastAlarmFallbackFactory implements FallbackFactory<RemoteBlastAlarm>
{
    @Override
    public RemoteBlastAlarm create(Throwable cause)
    {
        return new RemoteBlastAlarm()
        {
            @Override
            public R<Object> calcAlarm(String source)
            {
                return R.fail("服务异常，请稍后重试");
            }
        };
    }
}
